var util = require('./we7/resource/utils/util.js');
var QQMapWX = require('/we7/resource/utils/qqmap-wx-jssdk.js');
var qqmapsdk;
const app = getApp();

App({
  globalData:{
    StatusBar:123123,
    sum:0,
    location:{},
    url: 'https://wq.sitedown.top/attachment/',
    getPosution:'',
    tabbar: {
      color: "#242424",
      selectedColor: "#0084FF",
      backgroundColor: "#ffffff",
      borderStyle: "#d7d7d7",
      list: [
        {
          index: "0",
          pagePath: "/we7/pages/index/index",
          text: "首页",
          iconPath: "/we7/resource/images/shouYe.png",
          selectedIconPath: "/we7/resource/images/shouYe(1).png",
          selected: true
        },
        {
          index: "1",
          pagePath: "/we7/pages/faBu/faBu",
          text: "发帖",
          iconPath: "/we7/resource/images/faBu.png",
          selectedIconPath: "/we7/resource/images/faBu(1).png",
          selected: false
        },
        {
          index: "3",
          pagePath: "/we7/pages/mine/mine",
          text: "我的",
          iconPath: "/we7/resource/images/mine.png",
          selectedIconPath: "/we7/resource/images/mine(1).png",
          selected: false
        }
      ],
      position: "bottom"
    },
    moRenShop:""
  },
  onLaunch: function (res){
  },
  onShow: function (res){
    
  },
  setData:function(res){
    this.changeTabBar();
  },
  onHide: function (){
  },
  onError: function (msg) {
    console.log(msg)
  },
  util: util,
  userInfo: {
    sessionid: null,
  },
  changeTabBar:function (){
    var _curPageArr = getCurrentPages();
    var _curPage = _curPageArr[_curPageArr.length - 1];
    var _pagePath = _curPage.__route__;
    if (_pagePath.indexOf('/') != 0) {
      _pagePath = '/' + _pagePath;
    }
    var tabBar = this.globalData.tabbar;
    for (var i = 0; i < tabBar.list.length; i++) {
      tabBar.list[i].selected = false;
      if (tabBar.list[i].pagePath == _pagePath) {
        tabBar.list[i].selected = true;//根据页面地址设置当前页面状态  
      }
    }
    _curPage.setData({
      tabbar: tabBar
    });
  },
  siteInfo: require('siteinfo.js')
});